home *** CD-ROM | disk | FTP | other *** search
/ User's Choice Windows CD / User's Choice Windows CD (CMS Software)(1993).iso / misc1 / iv26_w30.zip / EXAMPLES / IDRAW / LISTIFON.H < prev    next >
C/C++ Source or Header  |  1980-01-05  |  3KB  |  91 lines

  1. /*
  2.  * Copyright (c) 1987, 1988, 1989 Stanford University
  3.  *
  4.  * Permission to use, copy, modify, distribute, and sell this software and its
  5.  * documentation for any purpose is hereby granted without fee, provided
  6.  * that the above copyright notice appear in all copies and that both that
  7.  * copyright notice and this permission notice appear in supporting
  8.  * documentation, and that the name of Stanford not be used in advertising or
  9.  * publicity pertaining to distribution of the software without specific,
  10.  * written prior permission.  Stanford makes no representations about
  11.  * the suitability of this software for any purpose.  It is provided "as is"
  12.  * without express or implied warranty.
  13.  *
  14.  * STANFORD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  15.  * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
  16.  * IN NO EVENT SHALL STANFORD BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  17.  * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  18.  * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
  19.  * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
  20.  * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  21.  */
  22.  
  23. // $Header: listifont.h,v 1.9 89/10/09 14:48:50 linton Exp $
  24. // declares classes IFontNode and IFontList.
  25.  
  26. #ifndef listifont_h
  27. #define listifont_h
  28.  
  29. #include "list.h"
  30.  
  31. // Declare imported types.
  32.  
  33. class IFont;
  34.  
  35. // An IFontNode contains an IFont pointer.
  36.  
  37. class IFontNode : public BaseNode {
  38. public:
  39.  
  40.     IFontNode (IFont* f) { font = f; }
  41.     boolean SameValueAs (void* p) { return font == p; }
  42.     IFont* GetFont () { return font; }
  43.  
  44. protected:
  45.  
  46.     IFont* font;        // points to an IFont
  47.  
  48. };
  49.  
  50. // An IFontList manages a list of IFontNodes.
  51.  
  52. class IFontList : public BaseList {
  53. public:
  54.  
  55.     IFontNode* First();
  56.     IFontNode* Last();
  57.     IFontNode* Prev();
  58.     IFontNode* Next();
  59.     IFontNode* GetCur();
  60.     IFontNode* Index(int);
  61.  
  62. };
  63.  
  64. // Cast these functions to return IFontNodes instead of BaseNodes.
  65.  
  66. inline IFontNode* IFontList::First () {
  67.     return (IFontNode*) BaseList::First();
  68. }
  69.  
  70. inline IFontNode* IFontList::Last () {
  71.     return (IFontNode*) BaseList::Last();
  72. }
  73.  
  74. inline IFontNode* IFontList::Prev () {
  75.     return (IFontNode*) BaseList::Prev();
  76. }
  77.  
  78. inline IFontNode* IFontList::Next () {
  79.     return (IFontNode*) BaseList::Next();
  80. }
  81.  
  82. inline IFontNode* IFontList::GetCur () {
  83.     return (IFontNode*) BaseList::GetCur();
  84. }
  85.  
  86. inline IFontNode* IFontList::Index (int index) {
  87.     return (IFontNode*) BaseList::Index(index);
  88. }
  89.  
  90. #endif
  91.